﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;

[Serializable]
public class Vector3Norm
{
    public Vector3 v
    {
        set { _v = value.normalized; }
        get { return _v; }
    }
    Vector3 _v;
    Vector3Norm(Vector3 v3)
    { v = v3; }
    public static implicit operator Vector3Norm(Vector3 v3)
    {
        return new Vector3Norm(v3.normalized);
    }
    public static implicit operator Vector3(Vector3Norm v3n)
    {
        return v3n.v;
    }
    Vector3Norm(Vector2 v3)
    { v = v3; }
    public static implicit operator Vector3Norm(Vector2 v3)
    {
        return new Vector3Norm(v3.normalized);
    }
    public static implicit operator Vector2(Vector3Norm v3n)
    {
        return v3n.v2;
    }
    public Vector2 v2
    {
        get
        {
            return new Vector2(v.x, v.z);
        }
    }
}
